package com.threeti.mecool.legacy.infrastructure.persistence;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.threeti.mecool.legacy.domain.model.basicdata.ProductLegacy;

public interface ProductLegacyRepository extends JpaRepository<ProductLegacy, String> {
  @Deprecated
  List<ProductLegacy> findByBrandCode(String brandCode);
  
  @Query("select p from ProductLegacy p, BrandLegacy b where p.brandCode = b.code and p.brandCode = ?2 and b.categoryCode = ?1")  
  List<ProductLegacy> findByBrandCategoryCodeAndBrandCode(String brandCategoryCode, String brandCode);
}
